// 关接口

import { baseUrl, Get } from '../../server'

const severName = 'finance/web' // 服务前缀名
const newBaseUrl = baseUrl + severName

/***************** 利润相关 张华***********************/
/**
 * 查询（全球/区域/国家）（年） 利润额同比增长情况  月的时候不调
 * 张华 http://yapi.tiens.com/project/550/interface/api/33263
 * 同比
 *
 */
const getProfitYoy: any = () => {
  const url = `${newBaseUrl}/profit/yoy/year?ymType=1&accountcode=AP9998000001`
  return Get(url)
}
// 环比
const getProfitMom: any = () => {
  const url = `${newBaseUrl}/profit/yoy/year?ymType=2&accountcode=AP9998000001`
  return Get(url)
}
/**
 * 查询（全球/区域/国家）（年）利润额趋势
 * 张华 http://yapi.tiens.com/project/550/interface/api/33371
 *
 */
const getProfitTrendVolume: any = () => {
  const url = `${newBaseUrl}/profit/trend/year?accountcode=AP9998000001&trendtype=1`
  return Get(url)
}
/**
 * 查询（全球/区域/国家）（年）利润率趋势
 * 张华 http://yapi.tiens.com/project/550/interface/api/33371
 *
 */
const getProfitTrendRate: any = () => {
  const url = `${newBaseUrl}/profit/trend/year?accountcode=AP9999000001&trendtype=2`
  return Get(url)
}
/**
 * 查询（全球/区域/国家）（月）利润额同环比
 * 张华 http://yapi.tiens.com/project/550/interface/api/33315
 *
 */
const getProfitQoq: any = () => {
  const url = `${newBaseUrl}/profit/yoymom/month?accountcode=AP9998000001`
  return Get(url)
}

/**
 * 查询(全球各区域/各国家)（月）收入同比增长
 * 张华 http://yapi.tiens.com/project/550/interface/api/33331
 *
 */
const getIncomeYOY: any = () => {
  const url = `${newBaseUrl}/profit/every/yoymom/month?ymType=1&accountcode=AP9998000001`
  return Get(url)
}
/**
 * 查询(全球各区域/各国家)（月）收入环比增长
 * 张华 http://yapi.tiens.com/project/550/interface/api/33331
 *
 */
const getIncomeQOQ: any = () => {
  const url = `${newBaseUrl}/profit/every/yoymom/month?ymType=2&accountcode=AP9998000001`
  return Get(url)
}
/**
 * 查询(全球各区域/各国家)（月）利润额/利润率
 * 张华 http://yapi.tiens.com/project/550/interface/api/33339
 *
 */
const getIncomeVolumeRate: any = () => {
  const url = `${newBaseUrl}/profit/every/compare?accountcode=AP9998000001+AP9999000001`
  return Get(url)
}
/**
 * 查询(全球各区域/各国家)（年/月）获取排名前五的亏损国家
 * 张华http://yapi.tiens.com/project/550/interface/api/33467
 */
const getTopFiveCountryRankingZero: any = () => {
  const url = `${newBaseUrl}/profit/every/ranking?profitstatus=0&accountcode=AP9998000001`
  return Get(url)
}
/**
 * 查询(全球各区域/各国家)（年/月）获取排名前五的利润额国家
 * 张华http://yapi.tiens.com/project/550/interface/api/33467
 */
const getTopFiveCountryRankingOne: any = () => {
  const url = `${newBaseUrl}/profit/every/ranking?profitstatus=1&accountcode=AP9998000001`
  return Get(url)
}
/**
 * 查询达成率（年/月）
 * 张华http://yapi.tiens.com/project/550/interface/api/33471
 */
const getAchievementRate: any = () => {
  const url = `${newBaseUrl}/profit/completion/rate?accountcode=AP9998000001`
  return Get(url)
}
/************/
/*******************边际贡献 蔚文杰**************************/
/**
 * 查询边际贡献额趋势（年）【折】
 * http://yapi.tiens.com/project/550/interface/api/33227
 *
 */
const getMarginalAmountRateTrend: any = () => {
  const url = `${newBaseUrl}/api/getMarginalAmountRateTrend?accountcode=99999997&marginalTrendType=1`
  return Get(url)
}
/**
 * 查询边际贡献率趋势（年）【折】
 * http://yapi.tiens.com/project/550/interface/api/33227
 *
 */
const getMarginalRateTrend: any = () => {
  const url = `${newBaseUrl}/api/getMarginalAmountRateTrend?accountcode=99999998&marginalTrendType=2`
  return Get(url)
}
/**
 * 查询边际贡献同比增长 全球边际贡献额同比增长情况 同比
 * http://yapi.tiens.com/project/550/interface/api/33231
 *
 */
const getMarginalAmountYOY: any = () => {
  const url = `${newBaseUrl}/api/getMarginalAmountYOYMOMGrow?accountcode=99999997&ymType=1`
  return Get(url)
}
/**
 * 查询 边际贡献额环比增长对比  环比
 * http://yapi.tiens.com/project/550/interface/api/33231
 *
 */
const getMarginalAmountMOMGrow: any = () => {
  const url = `${newBaseUrl}/api/getMarginalAmountYOYMOMGrow?accountcode=99999998&ymType=2`
  return Get(url)
}

/**
 * 查询边际贡献额与边际贡献率
 * http://yapi.tiens.com/project/550/interface/api/33235
 *
 */
const getMarginalAmoutRate: any = () => {
  const url = `${newBaseUrl}/api/getMarginalAmoutRate?accountcode=99999997+99999998`
  return Get(url)
}
/**
 * 查询边际贡献额同环比
 * http://yapi.tiens.com/project/550/interface/api/33239
 *
 */
const getMarginalAmountYOYMOMCompare: any = () => {
  const url = `${newBaseUrl}/api/getMarginalAmountYOYMOMCompare?accountcode=99999997+99999998`
  return Get(url)
}
/***********/
/*********************变动支出 谷守丙**************************/
/**
 * 年度-----全球,全区,国家变动支出（成本）占比趋势
 * http://yapi.tiens.com/project/550/interface/api/33215
 *
 */
const getVariableExpensesCost: any = () => {
  const url = `${newBaseUrl}/api/variableExpenses/getGlobalVariableExpensesYear?accountcode=AP6401000000`
  return Get(url)
}
/**
 * 年度-----全球,全区,国家变动支出（经销商工资）占比趋势
 * http://yapi.tiens.com/project/550/interface/api/33215
 *
 */
const getVariableExpensesWages: any = () => {
  const url = `${newBaseUrl}/api/variableExpenses/getGlobalVariableExpensesYear?accountcode=AP6601380000`
  return Get(url)
}
/**
 * 年度-----全球,全区,国家变动支出（代办费）占比趋势
 * http://yapi.tiens.com/project/550/interface/api/33215
 *
 */
const getVariableExpensesAgencyfee: any = () => {
  const url = `${newBaseUrl}/api/variableExpenses/getGlobalVariableExpensesYear?accountcode=AP6601370001`
  return Get(url)
}
/**
 * 年度-----全球,全区,国家变动支出（税费）占比趋势
 * http://yapi.tiens.com/project/550/interface/api/33215
 *
 */
const getVariableExpensesTax: any = () => {
  const url = `${newBaseUrl}/api/variableExpenses/getGlobalVariableExpensesYear?accountcode=AP6601420000`
  return Get(url)
}
/**
 * 年度-----全球,全区,国家变动支出（促销费）占比趋势
 * http://yapi.tiens.com/project/550/interface/api/33215
 *
 */
const getVariableExpensesPromotion: any = () => {
  const url = `${newBaseUrl}/api/variableExpenses/getGlobalVariableExpensesYear?accountcode=AP6601280000`
  return Get(url)
}

/**
 * 年度 各区,各国变动支出（成本）占比趋势
 * http://yapi.tiens.com/project/550/interface/api/33215
 *
 */
const getEveryVariableExpensesCost: any = () => {
  const url = `${newBaseUrl}/api/variableExpenses/getVariableExpensesByRegionYear?accountcode=AP6401000000`
  return Get(url)
}
/**
 * 年度 各区,各国变动支出（经销商工资）占比趋势
 * http://yapi.tiens.com/project/550/interface/api/33215
 *
 */
const getEveryVariableExpensesWages: any = () => {
  const url = `${newBaseUrl}/api/variableExpenses/getVariableExpensesByRegionYear?accountcode=AP6601380000`
  return Get(url)
}
/**
 * 年度 各区,各国变动支出（代办费）占比趋势
 * http://yapi.tiens.com/project/550/interface/api/33215
 *
 */
const getEveryVariableExpensesAgencyfee: any = () => {
  const url = `${newBaseUrl}/api/variableExpenses/getVariableExpensesByRegionYear?accountcode=AP6601370001`
  return Get(url)
}
/**
 * 年度 各区,各国变动支出（税费）占比趋势
 * http://yapi.tiens.com/project/550/interface/api/33215
 *
 */
const getEveryVariableExpensesTax: any = () => {
  const url = `${newBaseUrl}/api/variableExpenses/getVariableExpensesByRegionYear?accountcode=AP6601420000`
  return Get(url)
}
/**
 * 年度 各区,各国变动支出（促销费）占比趋势
 * http://yapi.tiens.com/project/550/interface/api/33215
 *
 */
const getEveryVariableExpensesPromotion: any = () => {
  const url = `${newBaseUrl}/api/variableExpenses/getVariableExpensesByRegionYear?accountcode=AP6601280000`
  return Get(url)
}
/**
 * 月度 全球，全区，国家重点变动支出对比
 * http://yapi.tiens.com/project/550/interface/api/33355
 *
 */
const getKeyVariableExpensesMonth: any = () => {
  const url = `${newBaseUrl}/api/variableExpenses/getGlobalVariableExpensesMonth?accountcode=1`
  return Get(url)
}
/**
 * 月度 各区,各国（4月）变动支出对比
 * http://yapi.tiens.com/project/550/interface/api/33367
 *
 */
const getVariableExpensesByRegionMonth: any = () => {
  const url = `${newBaseUrl}/api/variableExpenses/getVariableExpensesByRegionMonth?accountcode=11`
  return Get(url)
}
/****************  收入  吕金倩****************************/
// 全球、全区、 国家月度收入额与利润率
/*
 *  http://yapi.tiens.com/project/550/interface/api/33255
 **/
const getSalesAmountProfit: any = () => {
  const url = `${newBaseUrl}/sales/getSalesAmountProfit?accountcode=AP6001000000`
  return Get(url)
}
// 全球、全区、 国家收入同比增长情况（年度 月度）
/*
 *  http://yapi.tiens.com/project/550/interface/api/33259
 **/
const getSalesAmountYOY: any = () => {
  const url = `${newBaseUrl}/sales/getSalesAmountYOY?accountcode=AP6001000000`
  return Get(url)
}
// 全球、全区、 国家收入环比增长情况（年度 月度）
/*
 *  http://yapi.tiens.com/project/550/interface/api/33267
 **/
const getSalesAmountMOM: any = () => {
  const url = `${newBaseUrl}/sales/getSalesAmountMOM?accountcode=AP6001000000`
  return Get(url)
}
// 各区 各国 收入占比（年度 月度）
/*
 *  http://yapi.tiens.com/project/550/interface/api/33271
 **/
const getSalesPercent: any = () => {
  const url = `${newBaseUrl}/sales/getSalesPercent?accountcode=AP6001000000`
  return Get(url)
}
/**
 *
 *  收入同环比（月度）
 * http://yapi.tiens.com/project/550/interface/api/33431
 */
const getRevenueGrowthRate: any = () => {
  const url = `${newBaseUrl}/sales/getSalesYM?accountcode=AP6001000000`
  return Get(url)
}
// 收入趋势
/*
 *  http://yapi.tiens.com/project/550/interface/api/33275
 **/
const getSalesTrend: any = () => {
  const url = `${newBaseUrl}/sales/getSalesTrend?accountcode=AP6001000000`
  return Get(url)
}
//累计收入http://yapi.tiens.com/project/550/interface/api/35383
const getSalesCompare: any = () => {
  const url = `${newBaseUrl}/sales/getSalesCompare?accountcode=AP6001000000`
  return Get(url)
}
/******************************* 固定支出总额，增加额  张绅绅****/
// 固定支出总额趋势（全球，各区域，区域，各国，国家）
/*
 *  http://yapi.tiens.com/project/550/interface/api/33307
 **/
const getFixedExpensesAmount: any = () => {
  const url = `${newBaseUrl}/fixedCharge/lineChar/totalSum?accountcode=99999999`
  return Get(url)
}
// 固定支出总额同比增长情况（全球，区域，国家）
/*
 *  http://yapi.tiens.com/project/550/interface/api/33307
 **/
const getFixedExpensesAmountYOY: any = () => {
  const url = `${newBaseUrl}/fixedCharge/year/yoyTotalSum?accountcode=99999999`
  return Get(url)
}
// 固定支出总额同比增长情况（各区年，各区月，各国年，各国月）
/*
 *  http://yapi.tiens.com/project/550/interface/api/33319
 **/
const getFixedExpensesAmountYoyGrow: any = () => {
  const url = `${newBaseUrl}/fixedCharge/yoyTotalSum?accountcode=99999999`
  return Get(url)
}
// 固定支出总额环比增长对比（各区年，各区月，各国月）
/*
 *  http://yapi.tiens.com/project/550/interface/api/33335
 **/
const getFixedExpensesAmountQoq: any = () => {
  const url = `${newBaseUrl}/fixedCharge/momTotalSum?accountcode=99999999`
  return Get(url)
}
// 固定支出总额同环比（全球月，区域月，国家月）
/*
 *  http://yapi.tiens.com/project/550/interface/api/33343
 **/
const getFixedExpensesAmountYoyQoq: any = () => {
  const url = `${newBaseUrl}/fixedCharge/month/totalSum?accountcode=99999999`
  return Get(url)
}
// （各区，各国）固定支出总额与占比 月
/*
 *  http://yapi.tiens.com/project/550/interface/api/33599
 **/
const getTsotalSumAndRatio: any = () => {
  const url = `${newBaseUrl}/fixedCharge/get/totalSumAndRatio?accountcode=99999999`
  return Get(url)
}
// （全球月，区域月，国家月）固定支出
/*
 *  http://yapi.tiens.com/project/550/interface/api/33603
 **/
const getFixedExpenses: any = () => {
  const url = `${newBaseUrl}/fixedCharge/get/monthCost?accountcode=AP6601010000,AP6601070000,AP6601120000,AP6601040000,AP6601030000`
  return Get(url)
}
/******************全球财务接口-固定支出人工、咨询、公关、差旅，租赁 朱国清**********************/
// 费用支出信息 人工费
/*
 *  http://yapi.tiens.com/project/550/interface/api/33219
 **/
const getExpensesLaborCost: any = () => {
  const url = `${newBaseUrl}/api/expenses/get?accountcode=AP6601010000`
  return Get(url)
}
// 费用支出信息 租赁费
/*
 *  http://yapi.tiens.com/project/550/interface/api/33219
 **/
const getExpensesLeaseCost: any = () => {
  const url = `${newBaseUrl}/api/expenses/get?accountcode=AP6601070000`
  return Get(url)
}
// 费用支出信息 咨询服务费
/*
 *  http://yapi.tiens.com/project/550/interface/api/33219
 **/
const getExpensesConsultingCost: any = () => {
  const url = `${newBaseUrl}/api/expenses/get?accountcode=AP6601120000`
  return Get(url)
}
// 费用支出信息 公关费
/*
 *  http://yapi.tiens.com/project/550/interface/api/33219
 **/
const getExpensesPublicRelationsCost: any = () => {
  const url = `${newBaseUrl}/api/expenses/get?accountcode=AP6601040000`
  return Get(url)
}
// 费用支出信息 交通差旅费
/*
 *  http://yapi.tiens.com/project/550/interface/api/33219
 **/
const getExpensesTrafficCost: any = () => {
  const url = `${newBaseUrl}/api/expenses/get?accountcode=AP6601030000`
  return Get(url)
}
// 对比支出信息 人工费
/*
 *  http://yapi.tiens.com/project/550/interface/api/33223
 **/
const getContrastExpensesLaborCost: any = () => {
  const url = `${newBaseUrl}/api/contrast/get?accountcode=AP6601010000`
  return Get(url)
}
// 对比支出信息 租赁费
/*
 *  http://yapi.tiens.com/project/550/interface/api/33223
 **/
const getContrastExpensesLeaseCost: any = () => {
  const url = `${newBaseUrl}/api/contrast/get?accountcode=AP6601070000`
  return Get(url)
}
// 对比支出信息 咨询服务费
/*
 *  http://yapi.tiens.com/project/550/interface/api/33223
 **/
const getContrastExpensesConsultingCost: any = () => {
  const url = `${newBaseUrl}/api/contrast/get?accountcode=AP6601120000`
  return Get(url)
}
// 对比支出信息 公关费
/*
 *  http://yapi.tiens.com/project/550/interface/api/33223
 **/
const getContrastExpensesPublicRelationsCost: any = () => {
  const url = `${newBaseUrl}/api/contrast/get?accountcode=AP6601040000`
  return Get(url)
}
// 对比支出信息 交通差旅费
/*
 *  http://yapi.tiens.com/project/550/interface/api/33223
 **/
const getContrastExpensesTrafficCost: any = () => {
  const url = `${newBaseUrl}/api/contrast/get?accountcode=AP6601030000`
  return Get(url)
}
// 对比支出信息 交通差旅费
/*
 *  http://yapi.tiens.com/project/550/interface/api/33223
 **/
const getGlobalVariableExpensesCumulativeYear: any = () => {
  const url = `${newBaseUrl}/api/variableExpenses/getGlobalVariableExpensesCumulativeYear`
  return Get(url)
}
export const financeApi: any = {
  /***利润相关****/
  getProfitYoy,
  getProfitMom,
  getProfitTrendVolume,
  getProfitTrendRate,
  getProfitQoq,
  getIncomeYOY,
  getIncomeQOQ,
  getIncomeVolumeRate,
  getTopFiveCountryRankingZero,
  getTopFiveCountryRankingOne,
  getAchievementRate,
  /****边际贡献****/
  getMarginalAmountRateTrend,
  getMarginalRateTrend,
  getMarginalAmountYOY,
  getMarginalAmountMOMGrow,
  getMarginalAmoutRate,
  getMarginalAmountYOYMOMCompare,
  /****变动支出 谷守丙****/
  getVariableExpensesCost,
  getVariableExpensesWages,
  getVariableExpensesAgencyfee,
  getVariableExpensesTax,
  getVariableExpensesPromotion,
  getEveryVariableExpensesCost,
  getEveryVariableExpensesWages,
  getEveryVariableExpensesAgencyfee,
  getEveryVariableExpensesTax,
  getEveryVariableExpensesPromotion,
  getKeyVariableExpensesMonth,
  getVariableExpensesByRegionMonth,
  /***收入****/
  getSalesAmountProfit,
  getSalesAmountYOY,
  getSalesAmountMOM,
  getSalesPercent,
  getSalesTrend,
  getRevenueGrowthRate,
  getSalesCompare,
  /***固定支出总额，增加额 张绅绅****/
  getFixedExpensesAmount,
  getFixedExpensesAmountYOY,
  getFixedExpensesAmountYoyGrow,
  getFixedExpensesAmountQoq,
  getFixedExpensesAmountYoyQoq,
  getTsotalSumAndRatio,
  getFixedExpenses,
  /********全球财务接口-固定支出人工、咨询、公关、差旅，租赁 朱国清************/
  getExpensesLaborCost,
  getExpensesLeaseCost,
  getExpensesConsultingCost,
  getExpensesPublicRelationsCost,
  getExpensesTrafficCost,
  getContrastExpensesLaborCost,
  getContrastExpensesLeaseCost,
  getContrastExpensesConsultingCost,
  getContrastExpensesPublicRelationsCost,
  getContrastExpensesTrafficCost,
  getGlobalVariableExpensesCumulativeYear,
}
